import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import router from './router'
import axios from 'axios'

import util from './js/util';
Vue.use(ElementUI, { size: 'small', zIndex: 2000 });
//'large', 'medium', 'small'
Vue.config.productionTip = false

Vue.prototype.$http = axios;
Vue.prototype.goto=function(index){
  if(index.indexOf("http")==-1){
    this.$router.push(index);
  }else if(this.$root.mode!="pad"){
    let width =window.screen.width;
    let height =window.screen.height;
    window.open(index,"_blank","location=no,width="+width+",height="+height);
  }else{
    if(index.endsWith("#/order")){
      window.parent.postMessage([index],"http://"+location.hostname+":7000");

      //window.top.open("http://"+location.hostname+":7000/index.html#/order","_self")
    }else {
      window.open(index,"_blank");
    }
  }
}

new Vue({
  router,
  render: h => h(App),
  data: function () {
    return {
      user:{
        "realName":"六多合一",                //类型：String  必有字段  备注：真实名称
        "roleName":"六多合...",                //类型：String  必有字段  备注：角色名称
        "userName":"ldhy",                //类型：String  必有字段  备注：用户名称
        "currentOrgName":"宜昌自贸片区",                //类型：String  必有字段  备注：部门名称
        "weigetListSize":0
      },
      baseUrl:""
    }
  },
  created(){
    util.init(Vue,axios);

  }
}).$mount('#app')
